import 'package:flutter/material.dart';

class StackComp extends StatelessWidget {
  const StackComp({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      child: Stack(
        // 裁剪行为
        clipBehavior: Clip.none,
        // 层叠布局-对其方式
        alignment: Alignment.bottomCenter,
        children: [
          Container(
            width: 300,
            height: 300,
            color: Colors.red,
          ),
          Container(
            width: 200,
            height: 200,
            color: Colors.yellow,
          ),
          Positioned(
              top: 100,
              right: 20,
              child: Image.asset(
                'assets/open_eyes.png',
                width: 100,
                height: 100,
              ))
        ],
      ),
    );
  }
}
